package com.atguigu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * ClassName: ApplicationContextConfig
 * Description:
 * date: 2020/12/21 0021 18:17:34
 *
 * @author BaiMo
 * @since JDK 1.8
 */
@Configuration
public class ApplicationContextConfig {
    @Bean
    /**
     * 赋予RestTemplate负载均衡的能力
     */
    @LoadBalanced
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
//applicationContext.xml <bean id="" class="">